package com.example.networkinteraction.response;

import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;

/**
 * Description:
 * File: BasicResponse.java
 * Author: Administrator
 * Create: 2019/3/28 0028 下午 15:45
 */
public class BasicResponse<T> {
    @SerializedName(value = "Flag", alternate = "flag")
    private boolean flag;
    @SerializedName(value = "Msg", alternate = "message")
    private String msg;
    @SerializedName(value = "Code", alternate = "code")
    private int code;
    @SerializedName(value = "Data", alternate = "data")
    private T data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return new Gson().toJson(this);
    }
}
